import tailwindcss from '@tailwindcss/vite';
import VueSetupExtend from 'vite-plugin-vue-setup-extend';

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
	compatibilityDate: '2025-05-15',
	devtools: { enabled: true },
	app: {
		head: {
			htmlAttrs: {
				lang: 'zh-CN',
			},
			title: '蓝云博客-精简版',
			meta: [
				{ name: 'description', content: '蓝云博客-精简版' },
				{
					name: 'keywords',
					content: '蓝云博客,博客,个人博客,博客系统,蓝云博客精简版',
				},
			],
		},
	},
	css: ['~/assets/css/tailwind.css'],
	modules: [
		'@element-plus/nuxt',
		'nuxt-lodash',
		'@nuxt/image',
		[
			'@pinia/nuxt',
			{
				autoImports: [
					// 自动引入 `defineStore()`
					'defineStore',
					// 自动引入 `defineStore()` 并重命名为 `definePiniaStore()`
					['defineStore', 'definePiniaStore'],
				],
			},
		],
	],
	vite: {
		plugins: [VueSetupExtend(), tailwindcss()],
	},
	devServer: {
		port: 4090,
	},
	// 静态文件缓存配置
	nitro: {
		routeRules: {
			'/resource/**': {
				headers: {
					'cache-control': 'public, max-age=31536000, immutable',
				},
			},
		},
	},
});
